package com.jhws.core.mns.service;

import com.jhws.core.mns.bo.MNSMessage;

import java.util.List;

public interface IMNSService {
    /**
     * 创建队列
     *
     * @param queueName
     * @throws Exception
     */
    void createQueue(String queueName, int pollingWaitSeconds, Long retentionPeriod) throws Exception;

    /**
     * 删除队列
     *
     * @param queueName
     * @throws Exception
     */
    void deleteQueue(String queueName) throws Exception;

    /**
     * 发送消息
     *
     * @param queueName
     * @param message
     * @throws Exception
     */
    void producer(String queueName, String message) throws Exception;

    /**
     * 接收消息
     *
     * @param queueName
     * @throws Exception
     */
    MNSMessage comsumer(String queueName) throws Exception;

    /**
     * 接收消息
     *
     * @param queueName
     * @throws Exception
     */
    List<MNSMessage> comsumerList(String queueName, int batchSize) throws Exception;
}
